An oscillator is widely applied to the field of mobile communications technologies due to relatively high frequency stability. Currently, a quartz crystal oscillator is commonly used, and the quartz crystal oscillator can be classified into two types according to a frequency-temperature feature: One is a crystal oscillator (Crystal Oscillator, XO for short) without temperature compensation, which has relatively poor frequency stability and is easily affected by a temperature; the other is a temperature compensated crystal oscillator (Temperature Compensated Crystal Oscillator, TCXO for short), which refers to a crystal oscillator with a temperature compensation function. The XO is widely used on a low-cost baseband communications chip due to an obvious price advantage compared with the TCXO.
Because the XO does not have a temperature compensation module, an output frequency of the XO obviously varies with a temperature. When the XO is used as a reference clock source, a frequency deviation generated by the XO as a temperature changes needs to be estimated and compensated. A module that is on a user terminal and used to estimate and compensate a frequency deviation keeps in a working state when the user terminal is in a connected and non-DRX (Discontinuous Reception, discontinuous reception) state. Therefore, a frequency deviation can be correctly estimated and compensated. However, when a user terminal is in a DRX state and/or a module used to estimate and compensate a frequency deviation does not work, a temperature compensation module needs to be designed, so as to perform baseband or radio frequency compensation for a frequency variation. Currently, temperature compensation is generally implemented on a processor of the user terminal. Generally, an implementation method is to estimate, by using a curve fitting method, a feature that an XO output frequency varies with a temperature, measure temperatures before and after the temperature variation, calculate a difference between frequencies corresponding to the two temperatures according to a correspondence between a temperature and a frequency in a fitting curve, and perform baseband or radio frequency compensation according to the frequency difference. However, when a temperature of the XO drastically varies, after temperature compensation is performed by using the foregoing method, an excessively large frequency deviation may still remain in a system, thereby causing a temperature compensation exception, and the user terminal cannot perform normal communication.